<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<%@ taglib prefix="customer" tagdir="/WEB-INF/tags/customer"%>

<form class="mainForm" name="productReviewListForm" method="post" id="productReviewListForm" action="${ctxPath}/customer/productReview.html">
	<c:set var="editURLPath"	value="/customer/productReview.html?doAction=edit&from=list" scope="page" />
	<div class="top clearfix">
		<ul class="tab">
			<li class="curr"><span><fmt:message key="menu.productReviewList"/></span></li>
		</ul>
		<%@include file="/common/pagingOnlyTop.jsp"%>
	</div>
	<div class="data">		
		<c:set var="checkAll">
			<input type="checkbox" name="allbox" onclick="checkAll(this.form)"	class="checkbox" />
		</c:set>
		<c:set var="isNeedTopPaging" value="true"/>
		
		<table id="productReview" width="100%" border="0" cellspacing="0" cellpadding="0" class="list_table">	
			<tr>
			  	<th width="20"><input onclick="checkAll(this.form)" name="allbox" type="checkbox" value="" /></th>	
				<th style="width:20px;">
					<span class="expand" onclick="toggleScreenAll(this)">&nbsp;</span>
				</th>
				<th class='sortable ${(productReviewSearchCriteria.orderby eq 3)?"sorted order1":((productReviewSearchCriteria.orderby eq 4)?"sorted order2":"")}'>	
					<a onclick="sortField(this,3,4)"><fmt:message key="productReview.subject" /></a>
				</th>
				<th style="width:12%" class='sortable ${(productReviewSearchCriteria.orderby eq 9)?"sorted order1":((productReviewSearchCriteria.orderby eq 10)?"sorted order2":"")}'>	
					<a onclick="sortField(this,9,10)"><fmt:message key="productReview.createTime" /></a>
				</th>
				<th style="width:16%" class='sortable ${(productReviewSearchCriteria.orderby eq 5)?"sorted order1":((productReviewSearchCriteria.orderby eq 64)?"sorted order2":"")}'>
					<a onclick="sortField(this,5,6)"><fmt:message key="productReview.productName" /></a>
				</th>
				<th  style="width:10%" class='sortable ${(productReviewSearchCriteria.orderby eq 7)?"sorted order1":((productReviewSearchCriteria.orderby eq 8)?"sorted order2":"")}'>
					<a onclick="sortField(this,7,8)"><fmt:message key="productReview.score" /></a>
				</th>
				<th style="width:8%">
					<span><fmt:message key="productReview.reviewUser" /></span>
				</th>
				<th  style="width:12%">
					<span><fmt:message key="productReview.display" /></span>
				</th>
			</tr>
			<c:forEach var="productReview" items="${productReviewList}" varStatus="status">
				<tr id="tr${productReview.productReviewId}" productReviewId="${productReview.productReviewId}" class="${(status.index%2==0)?'even':'odd'}">
					<td>
						<input type="checkbox" name="multiIds"	value="${productReview.productReviewId}" class="checkbox"	title="${productReview.subject}" />
					</td>
					<td>
						 <span class="expand toggleScreen" onclick="toggleScreen(this)">&nbsp;</span>
					</td>
					<td>	                     
						${productReview.subject}
					</td>
					<td>
						<common:datetimeFormat date="${productReview.createTime}"/>
					</td>
					<td>
						${productReview.product.productName}
					</td>
					<td>
						<fmt:formatNumber var="score" value="${productReview.score}" pattern="0.0"/>
						<em>${score}</em>
						 <customer:scoreStar value="${score}"/>
					</td>
					<td>
						${productReview.reviewUserName}
					</td>
					<td>
						<span class="${(productReview.status == 1)?'show':'unShow'}" title="<fmt:message key="productReview.status.${(productReview.status == 1)?'show':'unShow'}"/>">&nbsp;</span>
						<span class="${(productReview.sortOrder == 0)?'top':'unTop'}" title="<fmt:message key="productReview.sortOrder.${(productReview.sortOrder == 0)?'top':'unTop'}"/>">&nbsp;</span>
						<span id="readStatus_${productReview.productReviewId}" class="${(productReview.isRead == 1)?'read':'unRead'}" title="<fmt:message key="productReview.isRead.${(productReview.isRead == 1)?'read':'unRead'}"/>">&nbsp;</span>
						<c:if test="${not empty productReview.customer}">
							<customer:shopPointInfoTip entityId="${productReview.productReviewId}" type="3" customerId="${productReview.customer.appuserId}"></customer:shopPointInfoTip>
						</c:if>
					</td>
				</tr>
				<tr style="display: none;"  class="${(status.index%2==0)?'even':'odd'} sub">
					<td></td>
					<td class="consignee" colspan="10">
						<div class="order_show">
							<table cellspacing="0" cellpadding="0" border="0" width="100%">
								<tr>
									<td class="consignee">
										<table cellspacing="0" cellpadding="0" border="0" width="100%" class="consignee_table">
											<tr>
												<th width="100px;"><fmt:message key="productReview.product"/>:</th>
												<td>
													<authorize:authorizeResource resourceString="/product/prod*">
														<c:set var="isAuth" value="true"/>
													</authorize:authorizeResource>
													<c:choose>
														<c:when test="${isAuth}">
															<product:productImage product="${productReview.product}" sizeType="s1" />
														</c:when>
														<c:otherwise>
															<product:productImage product="${productReview.product}" sizeType="s1" linkType="0" />
														</c:otherwise>
													</c:choose>
													<c:set var="isAuth" value="false"/>
												</td>
											</tr>
											<tr>
												<th><fmt:message key="productReview.reviewUser"/>:</th>
												<td>${productReview.reviewUserName}</td>
											</tr>
											<tr>
												<th><fmt:message key="productReview.createTime"/>:</th>
												<td><fmt:formatDate value="${productReview.createTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
											</tr>
											<tr>
												<th><fmt:message key="productReview.remoteIp"/>:</th>
												<td>${productReview.remoteIp}</td>
											</tr>
											<tr>
												<th><fmt:message key="productReview.address"/>:</th>
												<td>${productReview.address}</td>
											</tr>
										</table>
									</td>
									<td style="vertical-align:top;">
										<table cellspacing="0" cellpadding="0" border="0" width="100%" class="consignee_table" id="replyDiv_${productReview.productReviewId}">
											<tr>
												<th width="100px;"><fmt:message key="productReview.message"/>:</th>
												<td>${productReview.message}</td>
											</tr>
											<tr>
												<th><fmt:message key="productReview.replySituation"/>:</th>
												<td>
													<fmt:message key="productReview.replySituation.body.1"/>
													<span class="replyCount" id="replyCount_${productReview.productReviewId}">(${productReview.onShowReplyCount}/${productReview.replyCount})</span>
													&nbsp;<a href="javascript:void(0)" onclick="showDialogOfreplyDialog(${productReview.productReviewId})"><b><fmt:message key="productReview.replySituation.body.2"/></b></a>
													
													<span style="float:right">
														<a class="useful" style="cursor:text;">&nbsp;</a><fmt:message key="productReview.useful"/>(${productReview.usefulCount})
														&nbsp;<a class="unuseful" style="cursor:text;">&nbsp;</a><fmt:message key="productReview.unuseful"/>(${productReview.unusefulCount})
													</span>
												</td>
											</tr>
											<tr>
												<th><fmt:message key="productReview.replySituation.byAdministrator"/>:</th>
												<td>
													<span><textarea id="message_${productReview.productReviewId}" name="replyMessage" style="width:500px;height:100px;" class="textareatxt"></textarea></span>
													<br/><input type="button" class="btn3" value="<fmt:message key="productReview.button.reply"/>" onclick="replyReview(${productReview.productReviewId})"/>
													<input type="hidden" name="productReviewId" value="${productReview.productReviewId}"/>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>	
			</c:forEach>
			<c:if test="${empty productReviewList}">
				<tr>
					<td colspan="7" style="text-align:center">
						<fmt:message key="productReviewList.empty"/>
					</td>
				</tr>
			</c:if>
		</table>	
		<%@include file="/common/pagingOnly.jsp" %>
	</div>
</form>
<%--------保存查询条件 -------%>
<%@include file="productReviewSearchCriteriaStorage.jspf"%>

<script type="text/javascript">
$j(document).ready(function () {
	highlightTableRows("productReview");
});
</script>